<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@page import="com.messengerregistration.MessengerRegistrationVO"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
List list = (List)request.getAttribute("list");
%>
<html> 
	<head> 
	<title>道路交通安全管理信息联络员登记表打印页</title> 
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0></OBJECT>
	<!--media=print 这个属性可以在打印时有效--> 
	<style media=print> 
		.Noprint{display:none;}<!--用本样式在打印时隐藏非打印项目--> 
		.PageNext{page-break-after: always;}<!--控制分页-->
	</style>

	<style>
		.style_tab_head 
		{ 
		font-family: "仿宋_GB2312"; 
		font-size: 22pt; 
		}
		.forcePage
		{
		page-break-after : always;
		}
		.style_td 
		{ 
		border-bottom: 1 solid #000000; 
		border-left: 1 solid #000000; 
		border-right: 0 solid #ffffff; 
		border-top: 0 solid #ffffff;
		text-align: center;
		height : 45px;
		}
		.style_tab 
		{ 
		border-color: #000000 #000000 #000000 #000000; 
		border-style: solid; 
		border-top-width: 2px; 
		border-right-width: 2px; 
		border-bottom-width: 1px; 
		border-left-width: 1px; 
		}
		.NOPRINT { 
		font-family: "宋体"; 
		font-size: 9pt; 
		}
	</style>
	</head>
		
	<body>
		<center class="Noprint"> 
			<p> 
				<input type=button value=返回 onclick="window.history.back()"> 
			</p> 
		</center>
		<%
		for (int i=0; null!=list && i<list.size(); i++) {
			MessengerRegistrationVO vo = (MessengerRegistrationVO)list.get(i);
			if (i!=0) {
		%>
		<div class="forcePage">&nbsp;</div>
		<%
			}
		%>
		<table width="90%" border="0" align="center" cellpadding="2" cellspacing="0">
			<tr>
				<td width="29%">&nbsp;</td> 
				<td width="28%">&nbsp;</td> 
				<td width="43%">&nbsp;</td>
			</tr>
			<tr>
				<td width="29%">&nbsp;</td> 
				<td width="28%">&nbsp;</td> 
				<td width="43%">&nbsp;</td>
			</tr>
			<tr>
				<td colspan="3" align="center" class="style_tab_head">道路交通安全管理信息联络员登记表</td> 
			</tr> 
			<tr>
				<td width="29%">&nbsp;</td> 
				<td width="28%">&nbsp;</td> 
				<td width="43%">&nbsp;</td>
			</tr>
			<tr>
				<%
					String squadron = "&nbsp;";
					if ( vo.getSquadron()!=null && !"".equals(vo.getSquadron())) {
						squadron = vo.getSquadron();
					}
				%>
				<td width="35%">&nbsp;</td> 
				<td width="35%">&nbsp;</td> 
				<td width="30%"><%=squadron%></td>
			</tr>
			<tr>
				<td width="29%">&nbsp;</td> 
				<td width="28%">&nbsp;</td> 
				<td width="43%">&nbsp;</td>
			</tr> 
			<tr>
				<td colspan="3">
					<table width="90%" border="0" align="center" cellpadding="2" cellspacing="0" class="style_tab"> 
						<tr>
							<%
								String name = "&nbsp;";
								if ( vo.getName()!=null && !"".equals(vo.getName())) {
									name = vo.getName();
								}
								String gender = "&nbsp;";
								if ( vo.getGender()!=null && !"".equals(vo.getGender())) {
									gender = vo.getGender();
								}
							%>
							<td width="18%" class="style_td">姓名</td>
							<td width="25%" class="style_td"><%=name%></td>
							<td width="17%" class="style_td">性别</td>
							<td width="8%" class="style_td"><%=gender%></td>
							<td width="17%" class="style_td" colspan ="2" rowspan="4">
								贴<BR>照<BR>片<BR>处
							</td>
						</tr> 
						<tr>
							<%
								String position = "&nbsp;";
								if ( vo.getPosition()!=null && !"".equals(vo.getPosition())) {
									position = vo.getPosition();
								}
								String nation = "&nbsp;";
								if ( vo.getNation()!=null && !"".equals(vo.getNation())) {
									nation = vo.getNation();
								}
							%>
							<td width="18%" class="style_td">现任职务</td>
							<td width="25%" class="style_td"><%=position%></td>
							<td width="17%" class="style_td">民族</td>
							<td width="8%" class="style_td"><%=nation%></td>
						</tr>
						<tr>
							<%
								String phonenumber = "&nbsp;";
								if ( vo.getPhonenumber()!=null && !"".equals(vo.getPhonenumber())) {
									phonenumber = vo.getPhonenumber();
								}
								String religion = "&nbsp;";
								if ( vo.getReligion()!=null && !"".equals(vo.getReligion())) {
									religion = vo.getReligion();
								}
							%>
							<td width="18%" class="style_td">联系电话</td>
							<td width="25%" class="style_td"><%=phonenumber%></td>
							<td width="17%" class="style_td">政治面貌</td>
							<td width="8%" class="style_td"><%=religion%></td>
						</tr>
						<tr>
							<%
								String idcardnumber = "&nbsp;";
								if ( vo.getIdcardnumber()!=null && !"".equals(vo.getIdcardnumber())) {
									idcardnumber = vo.getIdcardnumber();
								}
							%>
							<td width="18%" class="style_td">身份证号码</td>
							<td width="50%" class="style_td" colspan="3"><%=idcardnumber%></td>
						</tr>
						<tr>
							<%
								String corporation = "&nbsp;";
								if ( vo.getCorporation()!=null && !"".equals(vo.getCorporation())) {
									corporation = vo.getCorporation();
								}
							%>
							<td width="18%" class="style_td">工作单位</td>
							<td width="82%" class="style_td" colspan="5"><%=corporation%></td>
						</tr>
						<tr>
							<%
								String address = "&nbsp;";
								if ( vo.getAddress()!=null && !"".equals(vo.getAddress())) {
									address = vo.getAddress();
								}
							%>
							<td width="18%" class="style_td">现居住地</td>
							<td width="82%" class="style_td" colspan="5"><%=address%></td>
						</tr>
						<tr>
							<%
								String dutyarea = "&nbsp;";
								if ( vo.getDutyarea()!=null && !"".equals(vo.getDutyarea())) {
									dutyarea = vo.getDutyarea();
								}
							%>
							<td width="18%" class="style_td">负责区域</td>
							<td width="82%" class="style_td" colspan="5"><%=dutyarea%></td>
						</tr>
						<tr>
							<%
								String appointmentnumber = "&nbsp;";
								if ( vo.getAppointmentnumber()!=null && !"".equals(vo.getAppointmentnumber())) {
									appointmentnumber = vo.getAppointmentnumber();
								}
							%>
							<td width="18%" class="style_td">聘书编号</td>
							<td width="82%" class="style_td" colspan="5">
								<table>
										<tr>
											<td  width="10%" >&nbsp;&nbsp;&nbsp;&nbsp;<font color="RED">★</font></td>
											<td style="text-align: center;"><%=appointmentnumber%></td>
											<td  width="10%" ><font color="RED">★</font>&nbsp;&nbsp;&nbsp;&nbsp;</td>
										</tr>
								</table>
							</td>
						</tr>
						<tr>
							<%
								String appointmentdate = "&nbsp;";
								if ( vo.getAppointmentdate()!=null && !"".equals(vo.getAppointmentdate())) {
									appointmentdate = vo.getAppointmentdate();
								}
							%>
							<td width="18%" class="style_td">聘用日期</td>
							<td width="82%" class="style_td" colspan="5"><%=appointmentdate%></td>
						</tr>
						<tr>
							<td width="18%" class="style_td"><BR>村<BR>支<BR>部<BR>意<BR>见<BR></td>
							<td width="82%" class="style_td" colspan="5">
								<table>
									<tr>
										<td  colspan="6">&nbsp;&nbsp;&nbsp;</td>
									</tr>
									<tr>
										<td colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;经村支部认真研究决定，特推荐      <%=name%></td>
									</tr>
									<tr>
										<td  colspan="6">&nbsp;&nbsp;&nbsp;</td>
									</tr>
									<tr>
										<td colspan="2">为肇东市公安交通警察大队       <%=squadron%>   中队驻</td>
									</tr>
									<tr>
										<td  colspan="6">&nbsp;&nbsp;&nbsp;</td>
									</tr>
									<tr>
										<td colspan="2"><%=dutyarea%> 屯道路交通安全管理特约信息联络员。</td>
									</tr>
									<tr>
										<td  colspan="6">&nbsp;&nbsp;&nbsp;</td>
									</tr>
									<tr>
										<td ><div style="float:right;">村支书：</div></td>
										<td>&nbsp;&nbsp;&nbsp;</td>
									</tr>
									<tr>
										<td  colspan="6">&nbsp;&nbsp;&nbsp;</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr> 
							<td width="18%" class="style_td" ><BR>乡<BR>镇<BR>党<BR>委<BR>意<BR>见</td>
							<td width="82%" class="style_td" colspan="5">
								<table>
									<tr>
										<td  colspan="6">&nbsp;&nbsp;&nbsp;</td>
									</tr>
									<tr>
										<td colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;同意     <%=dutyarea%>         村支部推荐   <%=name%>  为</td>
									</tr>
									<tr>
										<td  colspan="6">&nbsp;&nbsp;&nbsp;</td>
									</tr>
									<tr>
										<td colspan="2">肇东市公安交通警察大队 <%=squadron%> 中队道路交通安全</td>
									</tr>
									<tr>
										<td  colspan="6">&nbsp;&nbsp;&nbsp;</td>
									</tr>
									<tr>
										<td colspan="2">管理信息联络员。</td>
									</tr>
									<tr>
										<td  colspan="6">&nbsp;&nbsp;&nbsp;</td>
									</tr>
									<tr>
										<td colspan="6"><div style="float:right;">党委</div></td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td> 
			</tr> 
		</table>
		<%
		}
		%>
	</body>
</html>
<script language="javascript">
	var hkey_root="HKEY_CURRENT_USER" ; 
	var hkey_path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\"; 
	var hkey_key;
	function doPrint() {    
		//直接调用WebBrowser的打印，要打印预览的话是ExecWB(7,1) 直接打印ExecWB(6,6)
     	document.all.WebBrowser.ExecWB(6,6); 
	} 
	//设置纸张方向 
	function setupLandscape() { 
		try{ 
			var wsShell= new ActiveXObject("WScript.Shell"); 
			//打印页面的Menubar必须可见，此操作类似按键盘上的Alt+F+U也就是 调出页面设置对话框 
			wsShell.sendKeys('%fu'); 
			//此操作类似按键盘上的Alt+A也就是 设置横向打印 
			//wsShell.sendKeys('%a');
			//此操作类似按键盘上的Alt+O也就是 设置竖向打印 
			wsShell.sendKeys('%o'); 
			//此操作类似按键盘上的回车 页面设置对话框的默认焦点在 确定上 所以直接确定 
			wsShell.sendKeys('{ENTER}'); 
		} 
		catch(e){} 
	} 
	//设置默认的页眉页脚 
	function setupPage() { 
		try{ 
		var RegWsh = new ActiveXObject("WScript.Shell"); 
			hkey_key="header" 
			RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"") 
			hkey_key="footer" 
			RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"&b") //去掉了&u 因为我不想显示当前打印页的网址 
			hkey_key="margin_bottom"; 
			RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"0.39"); //0.39相当于把页面设置里面的边距设置为10 
			hkey_key="margin_left"; 
			RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"0.39"); 
			hkey_key="margin_right"; 
			RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"0.39"); 
			hkey_key="margin_top"; 
			RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"0.39"); 
		} 
		catch(e){} 
	} 
	setTimeout("setupLandscape()",1000); 
	setTimeout("setupPage()",2000); 
	setTimeout("doPrint()",3000); 
</script>